package cn.t.web.industry;

import cn.t.facade.industry.IndustryFacade;
import cn.t.vo.industry.IndustryCostCenterAmountVO;
import cn.t.vo.industry.IndustryDeviceSummaryVO;
import cn.t.vo.industry.IndustryDeviceVO;
import cn.t.vo.industry.IndustryOverviewVO;
import cn.t.vo.industry.IndustrySkuVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *  - 概览设备
 */
@Slf4j
@RestController
@RequestMapping("/industry")
@AllArgsConstructor
public class IndustryController {

    private final IndustryFacade industryFacade;

    /**
     * 现场看板-设备列表查询接口
     */
    @GetMapping("/device/list")
    public List<IndustryDeviceVO> list(@RequestParam(required = false) Long firmId, @RequestParam(required = false) String dimension) {
        return industryFacade.list(firmId);
    }

    /**
     * 现场看板-概览接口
     */
    @GetMapping("/overview/day")
    public IndustryOverviewVO overview(@RequestParam(required = false) Long firmId) {
        return industryFacade.overview(firmId);
    }

    /**
     * 汇总看板-本月概览接口
     */
    @GetMapping("/overview/month")
    public IndustryOverviewVO monthOverview(@RequestParam(required = false) Long firmId) {
        return industryFacade.monthOverview(firmId);
    }

    /**
     * 汇总看板-成本中心金额
     */
    @GetMapping("/costCenter/amount")
    public IndustryCostCenterAmountVO costCenterAmount(@RequestParam(required = false) Long firmId, @RequestParam Integer count) {
        return industryFacade.costCenterAmount(firmId, count);
    }

    /**
     * 汇总看板-智能柜本月领用情况
     */
    @GetMapping("/device/summary")
    public List<IndustryDeviceSummaryVO> deviceSummary(@RequestParam(required = false) Long firmId, @RequestParam Integer count) {
        return industryFacade.deviceSummary(firmId, count);
    }



}

